{
    "channelID": "_ch{{ item.channelnum|int }}",
{% if chaincode == "samplecc" %}
    "chaincodeID": "sample_cc",
{% elif chaincode == "samplejs" %}
    "chaincodeID": "sample_js",
{% elif chaincode == "marbles02_private" %}
    "chaincodeID": "marbles_cc_priv",
{% elif chaincode == "marbles02" %}
    "chaincodeID": "marbles_cc",
{% endif %}
    "chaincodeVer": "v0",
    "logLevel": "ERROR",
    "transType": "instantiate",
    "TLS": "{{ TLS }}",
    "channelOpt": {
        "name":  "{{ item.name }}",
        "action":  "create",
        "orgName": [
{% set index = ((item.channelnum|int * item.orgs|length) - (item.orgs|length - 1)) %}
            "org{{ index }}"
        ]
    },
    "timeoutOpt": {
        "preConfig": "{{ preconfig }}",
        "request": "{{ request }}",
        "grpcTimeout": "{{ grpcTimeout }}"
    },
    "deploy": {
{% if chaincode == "samplecc" %}
        "chaincodePath": "github.com/hyperledger/fabric-test/chaincodes/samplecc/go",
{% elif chaincode == "samplejs" %}
        "chaincodePath": "/root/go/src/github.com/hyperledger/fabric-test/chaincodes/samplecc/node",
        "language": "node",
{% elif chaincode == "marbles02_private" %}
        "chaincodePath": "github.com/hyperledger/fabric-test/fabric-samples/chaincode/marbles02_private/go",
        "collectionsConfigPath": "/root/go/src/github.com/hyperledger/fabric-test/tools/PTE/CITest/{{ testcase }}/preconfig/{{ chaincode }}/collections_config-chan{{ item.channelnum|int }}.json",
{% elif chaincode == "marbles02" %}
        "chaincodePath": "github.com/hyperledger/fabric-test/fabric-samples/chaincode/marbles02/go",
{% endif %}
        "fcn": "init",
        "endorsement": {
           "identities": [
{% for org in identities[0].orgs if org in item.orgs %}
               {
                   "role": { "name": "{{ identities[0].role }}", "mspId": "{{ org }}" }
{% if not loop.last %}
               },
{% else %}
               }
{% endif %}
{% endfor %}
            ],
            "policy": {
                {{ policy }}
            }
         },
        "args": []
    },
    "SCFile": [
                {"ServiceCredentials":"CITest/CISCFiles/config-chan{{ item.channelnum|int }}-TLS.json"}
        ]
}
